package com.tasly.attendance.util;

import java.util.Comparator;

import com.tasly.attendance.entity.AttendanceRecordEntity;

public class AttendanceTimeComparator implements Comparator<AttendanceRecordEntity> {

    @Override
    public int compare(AttendanceRecordEntity record0, AttendanceRecordEntity record1) {
        if (record0.getWorkingTime().before(record1.getWorkingTime())) {
            return -1;
        } else if (record0.getWorkingTime().after(record1.getWorkingTime())) {
            return 1;
        }
        return 0;
    }

}
